package com.ryskoo.customer.customerlevel.repository;

import com.ryskoo.common.constant.CacheConstant;
import com.ryskoo.customer.customerlevel.domain.CustomerLevelPO;
import com.ryskoo.framework.core.repository.BasicRedisImpl;
import com.ryskoo.framework.core.utils.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Repository;

import javax.annotation.PostConstruct;

/**
 * @author xman
 */
@Primary
@Repository
public class CustomerLevelRedisImpl extends BasicRedisImpl<CustomerLevelPO> implements ICustomerLevelRepository {

	@Autowired
	private RedisUtil redisClient;

	@Autowired
	private ICustomerLevelRepository customerLevelRepository;

	@PostConstruct
	public void init() {
		this.setRedisClient(redisClient);
		this.setDao(customerLevelRepository);
	}

	public CustomerLevelRedisImpl() {
		super(CacheConstant.CUSTOMER_LEVEL_KEY);
	}

}
